package com.zq.designpaterns.other.mvc;

/**
 * ================================================
 * 作    者：程志强
 * 邮    箱：cheng.zhiqiang@cesgroup.com.cn
 * 版    本：1.0.0
 * 创建日期：2021/01/26  11:04
 * 修改日期：
 * 描    述：
 * 修订历史：
 * ================================================
 */
public class StudentController {
    private final Student model;

    private final StudentView view;

    public StudentController(Student model, StudentView view) {
        this.model = model;
        this.view = view;
    }

    public String getRollNo() {
        return this.model.getRollNo();
    }

    public void setRollNo(String rollNo) {
        this.model.setRollNo(rollNo);
    }

    public String getName() {
        return this.model.getName();
    }

    public void setName(String name) {
        this.model.setName(name);
    }

    public void updateView() {
        this.view.printStudentDetail(this.model.getRollNo(), this.model.getName());
    }
}
